package leetcode100;

import java.util.Scanner;

/**
 * @author shkstart
 * @create 2022-12-23-21:33
 */
public class Meme21_1 {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      int group = scanner.nextInt();
        for (int i = 0; i < group; i++) {
            int n = scanner.nextInt();
            int k = scanner.nextInt();
            int []cards =new int[2*n];
            for (int j = 0; j < 2 * n; j++) {
                cards[j] = scanner.nextInt();
            }
            //洗牌
            method(cards,n,k);
            
        }

    }
    public static void method (int[] cards,int n,int k){
        for (int i = 0; i < k; i++) {//总共洗N次牌
//            洗一次
            int []newcard = new int[2*n];
            for (int h = 0; h <n; h++) {
                //i-->2*i
                //i-->2*i+1
                newcard[2*h] =cards[h];
                newcard[2*h+1] =cards[h+n];
            }
            cards = newcard;
            
        }
        for (int i = 0; i < cards.length-1; i++) {
            System.out.println(cards[i]+" ");
        }
        System.out.println(cards[cards.length-1]);
            

    }
}
